package Infinite::Sequence::Guard::Ascending;
use base qw{Infinite::Sequence::Guard};

sub guard {
    my( $this, $value ) = @_;
    
    unless( defined $this->{previous} ) {
        $this->{previous} = $value;
        return 1
    }
    
    return undef if $value < $this->{previous};
    
    $this->{previous} = $value;
    
    1
}

1
